<?php if (!defined('THINK_PATH')) exit();?>﻿<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>转诊会诊</title>
    <link rel="stylesheet" href="/yilianti/Public/home/js/layui/css/layui.css"/>
    <script src="/yilianti/Public/home/js/layui/layui.js"></script>
    <script src="/yilianti/Public/home/js/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script src="/yilianti/Public/home/js/zepto.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/yilianti/Public/home/js/TouchSlide.1.1.js"></script>
    <script src="/yilianti/Public/home/js/jQuery.textSlider.js"></script>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <link rel="stylesheet" href="/yilianti/Public/home/css/weui.css"/>
    <link rel="stylesheet" href="/yilianti/Public/home/css/myself.css"/>
    <script>
        layui.use('layer', function(){
            var layer = layui.layer;
        });
    </script>
</head>
<body>
<!--

-->


    <form id="ajaxForm">
        <input type="hidden"  name="hospital_now" id="hospital_now">
        <input type="hidden"  name="pid" id="pid">
        <input type="hidden"  name="cateid" id="cateid">
        <div class="weui-panel__bd ">
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label xinxi_label">医院</label></div>
                <div class="weui-cell__bd ">
                    <div class="weui-cell__bd weui-input input_border huizhen_zhuanzhen">
                        <input class="weui-input" type="text" placeholder="请选择医院" name="" id="hospital_now_name" disabled="disabled">
                        <a href="/yilianti/index.php/Referral/hospitallist" class="zhuand">转到</a>
                    </div>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label xinxi_label">患者</label></div>
                <div class="weui-cell__bd ">
                    <div class="weui-cell__bd weui-input input_border huizhen_zhuanzhen">
                        <input type="hidden" name="pname" class="pname">
                        <input class="weui-input pname" type="text" placeholder="请选择患者" disabled="disabled">
                        <a href="/yilianti/index.php/Referral/patientlist" class="zhuand">转到</a>
                    </div>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label xinxi_label">方式</label></div>
                <div class="weui-cell__bd sele_xial">
                    <select class="weui-select input_border  " name="type">
                        <option value="1">转诊</option>
                        <option value="2">会诊</option>
                    </select>
                </div>
            </div>
            <div class="weui-cell beizhu_kuang">
                <div class="weui-cell__hd"><label class="weui-label xinxi_label">备注</label></div>
                <div class="weui-cell__bd ">
                    <textarea class="weui-textarea" placeholder="请输入文本" rows="3" name="remarks"></textarea>
                </div>
            </div>
            <div class="button-sp-area xinxi_but_area">
                <a href="javascript:;" class="weui-btn weui-btn_mini weui-btn_default"  onclick="history.go(-1)">返回</a>
                <a href="javascript:;" class="weui-btn weui-btn_mini bingli_but" id="add">提交</a>
            </div>
        </div>
    </form>
    <script type="text/javascript">
        $(function(){
            referral = JSON.parse(localStorage.getItem('referral'));
            patient = JSON.parse(localStorage.getItem('patient'));
            cateid = JSON.parse(localStorage.getItem('cateid'));
            if(referral){
                $("#hospital_now").val(referral.hos_now_id);
                $("#hospital_now_name").val(referral.hos_now_name);
            }
            if(patient){
                $("#pid").val(patient.pid);
                $(".pname").val(patient.pname);
            }
            if(cateid){
                $("#cateid").val(cateid);
            }
            $("#add").click(function(){
                var hospital_now_name       = $('#hospital_now_name').val();
                var pname                   = $('#pname').val();
                var newpass2    = $('#newpass2').val();
                if(hospital_now_name == ''){
                    layer.msg('请选择医院！');
                    return false;
                }
                if(pname == ''){
                    layer.msg('请选择患者！');
                    return false;
                }
                var formData = $('#ajaxForm').serialize();
                $.ajax({
                    type:'post',
                    url:'/yilianti/index.php/Referral/index',
                    data:formData,
                    cache:false,
                    dataType:'json',
                    success:function(res){
                        if(res.code == 0){
                            layer.msg(res.msg,{time:2000},function () {
                                localStorage.removeItem('referral');
                                localStorage.removeItem('patient');
                                localStorage.removeItem('cateid');
                                window.location.href = res.url;
                            });
                            return false;
                        }else{
                            layer.msg(res.msg);
                            return false;
                        }
                    }
                });
            });
        });
    </script>



    <div class="weui-tabbar">
        <a href="/yilianti/index.php/Index/index" class="weui-tabbar__item weui-bar__item_on">
                <span style="display: inline-block;position: relative;">
                    <img src="/yilianti/Public/home/img/ind_01.png" alt="" class="weui-tabbar__icon">

                </span>
            <p class="weui-tabbar__label">首页</p>
        </a>
        <a href="/yilianti/index.php/Article/index" class="weui-tabbar__item">
            <img src="/yilianti/Public/home/img/ind_02.png" alt="" class="weui-tabbar__icon">
            <p class="weui-tabbar__label">新闻动态</p>
        </a>
        <a href="/yilianti/index.php/Referral/index" class="weui-tabbar__item">
                <span style="display: inline-block;position: relative;">
                    <img src="/yilianti/Public/home/img/ind_03.png" alt="" class="weui-tabbar__icon">

                </span>
            <p class="weui-tabbar__label">会诊转诊</p>
        </a>
        <a href="/yilianti/index.php/User/userlist" class="weui-tabbar__item">
            <img src="/yilianti/Public/home/img/ind_04.png" alt="" class="weui-tabbar__icon">
            <p class="weui-tabbar__label">个人中心</p>
        </a>
    </div>
    <script type="text/javascript">
        $(function(){
            $('.weui-tabbar__item').on('click', function () {
                $(this).addClass('weui-bar__item_on').siblings('.weui-bar__item_on').removeClass('weui-bar__item_on');
            });
        });
    </script>



</body>
</html>